import axios from 'axios'

let error = console.error

const api = '/product-templates/'

export default function getTemplateByCategoryId (id, cb, fcb = () => error('getTemplateByCategoryId')) {
  axios.get(`${api}${id}`).then(res => {
    let data = res.data
    cb(data)
  }).catch(error => {
    fcb(error)
  })
}
